﻿using System.Collections.Generic;
using KMF.Common;

namespace KMF.DAL
{
    public partial class SubCategoryTemplateDb
    {
        /// <summary>
        /// Lấy về tất cả template con theo danh sách template cha
        /// </summary>
        /// <param name="productCateTempMappingIdList"></param>
        /// <returns></returns>
        public static List<SubCategoryTemplateDto> GetAllByParentTemplateId(string productCateTempMappingIdList)
        {
            var dao = SharedSqlDao;
            var command = dao.GetDbSprocCommand("WSPX_Client_SubCategoryTemplate_GetAllByProCateTempMapId");
            try
            {
                command.Parameters.Add(dao.CreateParameter("@ProductCateTempMappingIdList", productCateTempMappingIdList));
                return dao.GetDTOList<SubCategoryTemplateDto>(ref command);
            }
            finally
            {
                command.Connection.Close();
            }
        }
    }
}
